<script setup lang="ts">
import BasicLayout from '@/layouts/BasicLayout.vue'
import { reactive } from 'vue'
import { message } from 'ant-design-vue'
// import { healthCheck } from '@/api/healthController.ts'

// healthCheck().then((res) => {
//   console.log(res)
// })
import { userRegister } from '@/api/userController.ts'
const formState = reactive<API.UserRegisterRequest>({
  userAccount: 'admincqq',
  userPassword: '123456789',
  checkPassword: '123456789',
})
const handleSubmit = async (values: API.UserRegisterRequest) => {
  const res = await userRegister(values)
  // 注册成功，跳转到登录页面
  if (res.data.code === 0) {
    message.success('注册成功')
  } else {
    message.error('注册失败，' + res.data.message)
  }
}
</script>

<template>
  <BasicLayout />
  <!-- <a-button type="primary" @click="handleSubmit(formState)">注册</a-button> -->
</template>

<style>
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: #f0f2f5;
}

html {
  overflow-x: hidden;
}
</style>
